/**************************************************************************
 *                                                                        *
 *         Copyright (c) 2007 by Sunplus mMedia Inc.                      *
 *                                                                        *
 *  This software is copyrighted by and is the property of Sunplus        *
 *  mMedia Inc. All rights are reserved by Sunplus mMedia Inc.  This      *
 *  software may only be used in accordance with the corresponding        *
 *  license agreement. Any unauthorized use, duplication, distribution,   *
 *  or disclosure of this software is expressly forbidden.                *
 *                                                                        *
 *  This Copyright notice MUST not be removed or modified without prior   *
 *  written consent of Sunplus mMedia Inc.                                *
 *                                                                        *
 *  Sunplus mMedia Inc. reserves the right to modify this software        *
 *  without notice.                                                       *
 *                                                                        *
 *  Sunplus mMedia Inc.                                                   *
 *  19-1, Innovation First Road, Science-Based Industrial Park,           *
 *  Hsin-Chu, Taiwan, R.O.C.                                              *
 *                                                                        *
 **************************************************************************/

#ifndef __HAL_UART_H__
#define __HAL_UART_H__

/******FOR UART FUNCTION****************/
#if 1

#define UART_FUNC 

#endif
/***************************************/

//=============================================================================
//Header file
//=============================================================================
#include "general.h"

//=============================================================================
//Symbol
//=============================================================================
typedef void (code* pUartHandle)(void);
//-----------------------------------------------------------------------------
//Constant
//-----------------------------------------------------------------------------
typedef enum _BAUDRATE{
	BAUDRATE_19200 = 0x00,
	BAUDRATE_57600 = 0x01,	
	BAUDRATE_115200 = 0x02,
	BAUDRATE_MAX = 0x03,
} _BAUDRATE_t;

typedef enum _UART_MODE{
	UART_MODE_DEBUG = 0x00,
	UART_MODE_COMMUNICATE = 0x01,
	UART_MODE_DISABLE = 0x02,
	UART_MODE_MAX = 0x03,
} _UARTMODE_t;

typedef enum _ACK_MODE{
	ACK_MODE_NULL = 0x00,
	ACK_MODE_ENTER = 0x01,
	ACK_MODE_CHAR = 0x02,
	ACK_MODE_MAX = 0X03,
} _ACKMODE_t;
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
void uartIntrRoutine(void);
void UartBaudrateset(UINT32 Baudrate);
void UartModeset(UINT8 mode);
void UartSend(char message_s);
void UartSend_Str(UINT8 *P);
void UartAckProcess(char c);
UINT8 * UartDataget(void);
void UartAckset(UINT8 mode);

#endif /*__HAL_UART_H__*/
